/**
 * 
 */
package com.india.bus.delhi;

import com.india.RouteCode;
import com.india.StopNode;
import com.sangharsh.core.algo.location.Location;

/**
 * @author pradeep
 *
 */
public enum DTCNode implements StopNode {

	SHIVAJI_STD_TERMINAL(201,"SHIVAJI STADIUM TERMINAL",28.63258,77.21541, true)
	,PALIKA_KEND(202,"PALIKA KEND",1,1,false)
	,KIRSHI_BHAWAN(203,"KIRSHI BHAWAN", 1, 1, false)
	,TEEN_MURTI(204,"TEEN MURTI",1,1,false)
	,USSR_EMBASSAY(205,"USSR EMBASSAY",1,1,false)
	,MOTI_BAGH_I(206,"MOTI BAGH -I",1,1,false)
	,S_M_TEMPLE(207,"S.M. TEMPLE",1,1,false)
	,IIT_HOSTEL(208,"IIT HOSTEL",28.55071,77.18329,true)
	,HAUZ_KHAS_TERMINAL(209, "HAUZ KHAS TERMINAL",28.54391,77.20185,true)
	,IIT_GATE(210,"IIT GATE",28.54593,77.19707, true)
	,BER_SERAI(211,"BER SERAI",28.55130,77.18189, false)
	,DTC_VASANT_VIHAR_DEPOT(212,"DTC VASANT VIHAR DEPOT",28.55916,77.16990, false)
	,KATWARIA_SERAI(213,"KATWARIA_SERAI",28.54061,77.18483, false)
	;

	// Bus Nodes
	private int id;
	private String name;
	private double longitude;
	private double latitude;
	private boolean active;
	private RouteCode routeCode;

	DTCNode(int id, String name, double latitude, double longitude, boolean active) {
		this.id = id;
		this.name = name;
		this.latitude = latitude;
		this.longitude = longitude;
		this.active = active;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public double getLongitude() {
		return longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public String getCode() {
		return this.toString();
	}

	public boolean isActive() {
		return active;
	}
	
	@Override
	public RouteCode getRouteCode() {
		return routeCode;
	}

	@Override
	public void setRouteCode(RouteCode routeCode) {
		this.routeCode = routeCode;
	}

	public static StopNode lookupById(int id){
		for(DTCNode node : values()){
			if(node.getId() == id){
				return node;
			}
		}
		return null;
	}
	@Override
	public Location getLocation(){
		return Location.getLocation(this.latitude, this.longitude);
	}
}
